import { Demo2Component } from './demo2/demo2.component';
import { BasicComponent } from './basic/basic.component';
import { MoreComponent } from './more/more.component';
import { PageSizeComponent } from 'cxd/showcase/paginator/page-size/page-size.component';

export const PaginatorConfig = {
  location: 'Paginator',
  description: '当数据量过多时，使用分页分解数据。分页控件一般搭配表格使用',
  description_en: 'When there is too much data, use page breakup to decompose the data. Paging control is generally used with tables.',
  component: [
    {
      demo: BasicComponent,
      codePath: 'showcase/paginator/basic/basic.component',
      demoTitle: '基础使用',
      demoTitle_en: 'Basic',
      demoDescription: '如果内容超过25条时，建议使用分页。',
      demoDescription_en: 'If the content exceeds 25, it is recommended to use the home page.',
    },
    {
      demo: MoreComponent,
      codePath: 'showcase/paginator/more/more.component',
      demoTitle: '更多',
      demoTitle_en: 'More Page',
      demoDescription: '更多分页。',
      demoDescription_en: 'More page.',
    },
    {
      demo: PageSizeComponent,
      codePath: 'showcase/paginator/page-size/page-size.component',
      demoTitle: '每页条数',
      demoTitle_en: 'Articles per page',
      demoDescription: '切换每页条数。',
      demoDescription_en: 'Toggle the number of items per page.',
    },
    {
      demo: Demo2Component,
      codePath: 'showcase/paginator/demo2/demo2.component',
      demoTitle: '精简分页',
      demoTitle_en: 'Simple Mode',
      demoDescription: '点击页数选择框可以快速选择器想要跳转的页面。',
      demoDescription_en: 'Click the page number selection box to quickly select the page you want to jump to.',
    },
  ],
  useRule: [],
  useSuggestion: [],
  selector: 'lv-paginator',
  snippet: `<lv-paginator lvTotal="\${1:80}"></lv-paginator>`,
  mApi: [
    {
      name: 'lv-paginator',
      name_en: 'lv-paginator',
      selector: 'lv-paginator',
      api: [
        {
          attribute: 'lvTotal',
          type: 'number',
          default: '0',
          description: '总页数',
          description_en: 'Total pages',
        },
        {
          attribute: 'lvShowTotal',
          type: 'boolean',
          default: 'true',
          description: '是否显示总页数',
          description_en: 'Whether to display the total number of pages',
        },
        {
          attribute: 'lvPageIndex',
          type: 'number',
          default: '0',
          description: '当前页数，默认从 0 页开始',
          description_en: 'Current page number, defaults from 0',
        },
        {
          attribute: 'lvPageSize',
          type: 'number',
          default: '25',
          description: '每页条数',
          description_en: 'Number of pages per page',
          global: true,
        },
        {
          attribute: 'lvShowPageSizeOptions',
          type: 'boolean',
          default: 'true',
          description: '是否显示每页条数切换选项',
          description_en: 'Whether to display the number of bars per page',
        },
        {
          attribute: 'lvPageSizeOptions',
          type: 'number[]',
          default: '[10, 25, 50, 100]',
          description: '指定每页可以显示多少条',
          description_en: 'Specify how many pieces can be displayed per page',
          global: true,
        },
        {
          attribute: 'lvDisabled',
          type: 'boolean',
          default: 'false',
          description: '是否禁用',
          description_en: 'Is it disabled',
        },
        {
          attribute: 'lvShowQuickjump',
          type: 'boolean',
          default: 'true',
          description: '是否显示快捷跳转',
          description_en: 'Whether to display the quick jump',
        },
        {
          attribute: 'lvShowSelected',
          type: 'boolean',
          default: 'false',
          description: '是否显示选中条数，当选中条数为0时不显示',
          description_en: 'Whether to display the selection number. If the number of selected records is 0, the selected records are not displayed.',
        },
        {
          attribute: 'lvSelected',
          type: 'number',
          default: '0',
          description: '选中条数',
          description_en: 'Selection number',
        },
        {
          attribute: 'lvHideOnSinglePage',
          type: 'boolean | number',
          default: 'false',
          description: '只有一页时是否隐藏分页器; 设置为数字时,当total小于该值时隐藏分页器',
          description_en: 'Whether to hide the pager when there is only one page.When this parameter is set to a number, the pager is hidden when total is less than the value of this parameter.',
        },
        {
          attribute: 'lvMode',
          type: '"default" | "simple"',
          default: 'default',
          description: '分页器模式：默认、简单',
          description_en: 'Pager mode: default, simple',
        },
        {
          attribute: 'lvPanelClass',
          type: 'string',
          default: '',
          description: `自定义下拉面板的样式类`,
          description_en: `Customizing the style class of the panel`,
        },
      ],
      event: [
        {
          event: 'lvPageChange',
          parameter: `{
            pageSize: number;
            pageIndex: number,
            total: number;
          }`,
          description: '页码改变或每页条数改变的回调',
          description_en: 'The event that is emitted when the pager changes the page size or page index',
        },
      ],
    },
  ],
};
